diff options
| author | Sebastien Castiel <sebastien@castiel.me> | 2024-01-29 22:37:13 -0500 |
|---|---|---|
| committer | Sebastien Castiel <sebastien@castiel.me> | 2024-01-30 12:57:21 -0500 |
| commit | 9e300e0ff0c9d93cbaeaa86c1e2a560523107382 (patch) | |
| tree | ebeaea60117fbac781a415e3299395f3f8e637d7 /src/app/groups/[groupId]/expenses/[expenseId]/edit | |
| parent | 3847a67a192a04098643e19953549a99ca152b8a (diff) | |
Use React’s cache to avoid some queries to the database
Diffstat (limited to 'src/app/groups/[groupId]/expenses/[expenseId]/edit')
| -rw-r--r-- | src/app/groups/[groupId]/expenses/[expenseId]/edit/page.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/app/groups/[groupId]/expenses/[expenseId]/edit/page.tsx b/src/app/groups/[groupId]/expenses/[expenseId]/edit/page.tsx index 8455d4d..65b2b50 100644 --- a/src/app/groups/[groupId]/expenses/[expenseId]/edit/page.tsx +++ b/src/app/groups/[groupId]/expenses/[expenseId]/edit/page.tsx @@ -1,9 +1,9 @@ +import { cached } from '@/app/cached-functions' import { ExpenseForm } from '@/components/expense-form' import { deleteExpense, getCategories, getExpense, - getGroup, updateExpense, } from '@/lib/api' import { expenseFormSchema } from '@/lib/schemas' @@ -21,7 +21,7 @@ export default async function EditExpensePage({ params: { groupId: string; expenseId: string } }) { const categories = await getCategories() - const group = await getGroup(groupId) + const group = await cached.getGroup(groupId) if (!group) notFound() const expense = await getExpense(groupId, expenseId) if (!expense) notFound() |
